<?php

namespace app;

use epii\ui\upload\driver\UploaderResult;
use wenshizhengxin\unicloud_oss\UnicloudOSS;

class file extends base
{
    public function upload()
    {
        try {
            $result = UnicloudOSS::uploadFiles();

            $ret = new UploaderResult();

            $ret->success($result['path'], $result['url']);
            exit(json_encode($ret->getResult(), JSON_UNESCAPED_UNICODE));
        } catch (\Exception $e) {

            echo $e->getMessage();
        }
    }
}
